/*
 * @Author: jjjjwei 1506865174@qq.com
 * @Date: 2022-08-04 11:38:48
<<<<<<< HEAD
 * @LastEditors: jjjjwei 1506865174@qq.com
 * @LastEditTime: 2022-08-17 10:44:32
 * @FilePath: \react\react-routemanage\src\utils\axios.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import Axios from 'axios'
const axios=Axios.create({
    baseURL: 'http://43.142.47.222:8080'
=======
 * @LastEditors: Xia_cc 978487464@qq.com
 * @LastEditTime: 2022-08-15 21:43:30
 * @FilePath: \react\react-routemanage\src\utils\axios.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import axios from "axios";

const ConfigBaseURL ="http://43.142.47.222:8080"

const Service = axios.create({
  // baseURL: 'http://172.16.110.43:8888'
  baseURL: ConfigBaseURL,
  // 请求超时时间
  timeout: 8000,
>>>>>>> 039e0124ae27cd35272dcd158b54ac6820d646eb
});
// 给post请求添加头设置
Service.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";

// 拦截Axios发起的所有请求，通过dispatch修改isLoading为true

Service.interceptors.request.use(
    config => {
        //需要把token添加到header中
        console.log(config);
        return config;
        
    },
    err => {
        return Promise.reject(err);
    });
//拦截Axios发起的所有响应，通过dispatch修改isLoading为false
Service.interceptors.response.use((config)=>{
    //需要将token 存起来
    return config
})

export default Service




